package cn.kami.dao.proxy;

import cn.kami.dao.IBatterySaveDAO;
import cn.kami.dao.impl.BatterySaveDAOImpl;
import cn.kami.dbc.DatabaseConnection;
import cn.kami.factory.DatabaseConnectionFactory;

public class BatterySaveDAOProxy implements IBatterySaveDAO{
	private DatabaseConnection dbc = null;
	private BatterySaveDAOImpl dao = null;
	public BatterySaveDAOProxy()throws Exception{
		this.dbc = DatabaseConnectionFactory.getOracleDatabaseConnection();
		this.dao = new BatterySaveDAOImpl(this.dbc.getConnection());
	}
	@Override
	public boolean doCreate(String bsID, String batID) throws Exception {
		// TODO Auto-generated method stub
		boolean flag = false;
		try{
			flag = this.dao.doCreate(bsID, batID);
		}catch(Exception e){
			throw e;
		}finally{
			this.dbc.close();
		}
		return flag;
	}
	
}
